From: Keir Fraser Date: Thu, 13 Aug 2009 07:40:39 +0000 (+0100) Subject: gdbstub: Fix the build and make a few cleanups. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13486 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=dfa275f7d929ad342e0844e155286432b6f6c197;p=xen.git gdbstub: Fix the build and make a few cleanups. Signed-off-by: Keir Fraser --- diff --git a/xen/common/gdbstub.c b/xen/common/gdbstub.c index 512172a1aa..a345fa797c 100644 --- a/xen/common/gdbstub.c +++ b/xen/common/gdbstub.c @@ -71,15 +71,14 @@ string_param("gdb", opt_gdb); static void gdbstub_console_puts(const char *str); /* value <-> char (de)serialzers */ -char +static char hex2char(unsigned long x) { const char array[] = "0123456789abcdef"; - return array[x & 15]; } -int +static unsigned int char2hex(unsigned char c) { if ( (c >= '0') && (c <= '9') ) @@ -93,13 +92,13 @@ char2hex(unsigned char c) return -1; } -char +static unsigned char str2hex(const char *str) { return (char2hex(str[0]) << 4) | char2hex(str[1]); } -unsigned long +static unsigned long str2ulong(const char *str, unsigned long bytes) { unsigned long x = 0; @@ -116,7 +115,7 @@ str2ulong(const char *str, unsigned long bytes) return x; } -unsigned long +static unsigned long str_to_native_ulong(const char *str) { unsigned long x = 0, i = 0; @@ -125,9 +124,9 @@ str_to_native_ulong(const char *str) { #ifdef __BIG_ENDIAN x <<= 8; - x += str2hex(*str); + x += str2hex(str); #elif defined(__LITTLE_ENDIAN) - x += (unsigned long)str2hex(*str) << (i*8); + x += (unsigned long)str2hex(str) << (i*8); #else # error unknown endian #endif diff --git a/xen/include/xen/gdbstub.h b/xen/include/xen/gdbstub.h index e87cf30470..e9f0cd5a27 100644 --- a/xen/include/xen/gdbstub.h +++ b/xen/include/xen/gdbstub.h @@ -26,12 +26,6 @@ #ifdef CRASH_DEBUG -/* value <-> char (de)serialzers for arch specific gdb backends */ -char hex2char(unsigned long x); -int char2hex(unsigned char c); -char str2hex(const char *str); -unsigned long str2ulong(const char *str, unsigned long bytes); - struct gdb_context { int serhnd; /* handle on our serial line */ int console_steal_id; /* handle on stolen console */